<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/27 0027
 * Time: 10:54
 */

namespace app\admin\validate;


use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'data'      =>  '',
        'account'   =>  'require|max:64|min:6|unique:admin',
        'password'  =>  'require|max:64|min:6',
        'aid'       =>  'require|integer'
    ];

    protected $message = [
        'account.require'       =>  '请输入账号',
        'account.max'           =>  '账号过长',
        'account.min'           =>  '账号长度过短',
        'account.unique'        =>  '账号已存在',
        'password.require'      =>  '请输入密码',
        'password.max'          =>  '密码过长',
        'password.min'          =>  '密码过短',
        'aid.require'           =>  '请选择管理员',
        'aid.integer'           =>  '请选择正确的选项',
    ];

    protected $scene = [
        'adminadd'      =>  ['account','password'],
        'adminlist'     =>  ['data'],
        'admindetail'   =>  ['aid'],
        'adminrepassword'=> ['aid','password'],
        'admindel'       => ['aid'],

    ];
}